@section('meta')
    <link rel="stylesheet" href="{{ asset('lib/layui/css/layui.css') }}">
    <link rel="stylesheet" href="{{ asset('css/login.css') }}">
@endsection
@section('title')
    登录
@endsection
@include('Home.Common._meta')
@include('Home.Common._menu')
<!--  content  -->
<div class="bg_1"></div>
<div class="bg_2"></div>
<div class="st-container">
    <div id="fullpage" class="fullpage-wrapper" style="height: 100%;">
        <div class="section active" id="section5">
            <div class="ct_container">
                <div class="ct_box1 clearfix">
                    <div class="img_box1">
                        <img src="{{ asset('images/denglu_1.png') }}" alt="登录界面">
                    </div>
                    <div class="txt_box1">

                        <h2>您正在使用{{get_config_cache('title')}}</h2>
                        <div class="layadmin-user-login-main">

                            <div class="layadmin-user-login-box layadmin-user-login-header" style="background: url(/images/logo1.png) no-repeat center center;height: 120px;min-width: 222px;max-width: 90%;margin: 0 auto;margin-top: 15px;">

                            </div>
                            <form method="post" class="layadmin-user-login-box layadmin-user-login-body layui-form">
                                @csrf
                                <div class="layui-form-item">
                                    <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
                                    <input type="text" name="username" value="{{ old('username') }}" id="LAY-user-login-username" lay-verify="required|username" placeholder="请输入登录用户名" class="layui-input">
                                </div>
                                <div class="layui-form-item">
                                    <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                                    <input type="password" name="password" value="{{ old('password') }}" id="LAY-user-login-password" lay-verify="required|password" placeholder="请输入登录密码" class="layui-input">
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-row">
                                        <div class="layui-col-xs7">
                                            <label class="layadmin-user-login-icon layui-icon layui-icon-vercode" for="LAY-user-login-vercode"></label>
                                            <input type="text" name="captcha" id="LAY-user-login-vercode" lay-verify="required|vercode" placeholder="请输入验证码" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs5">
                                            <div style="margin-left: 10px;">
                                                <img src="{{captcha_src()}}" id="LAY-user-get-vercode" onclick="this.src='{{captcha_src()}}'+Math.random()*Math.random()">
                                            </div>
                                        </div>
                                    </div>
                                </div>
{{--                                <div class="layui-form-item" style="margin-bottom: 20px;">
                                    <input type="checkbox" name="remember" value="1" @if(boolval(old('remember'))) checked @endif lay-skin="primary" title="记住密码">
                                    <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span>记住密码</span><i class="layui-icon layui-icon-ok"></i></div>
                                </div>--}}
                                <div class="layui-form-item">
                                    <button class="layui-btn layui-btn-fluid" lay-submit="" lay-filter="LAY-user-login-submit">登 录</button>
                                </div>
                                @if(count($errors))
                                    <div class="layui-form-item error-item layui-anim-fadein layui-bg-red">
                                        @foreach($errors->all() as $error)
                                            <li>{{$error}}</li>
                                        @endforeach
                                    </div>
                                @endif
                            </form>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="{{ asset('js/jquery.min.js') }}"></script>
<script src="{{ asset('js/fullpage.js') }}"></script>
<script src="{{ asset('lib/layui/layui.js') }}"></script>
<script type="text/javascript">
    $(document).ready(function() {
        $('#fullpage').fullpage({
            //options here
            licenseKey: 'OPEN-SOURCE-GPLV3-LICENSE',
        });

        $('.error-item').delay(3000).fadeOut();
    });
</script>
<script>

    layui.use(['form', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer;

        //自定义验证规则
        form.verify({
            username: function(value, item){ //value：表单的值、item：表单的DOM对象
                if(!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(value)){
                    return '用户名不能有特殊字符';
                }
                if(/(^\_)|(\__)|(\_+$)/.test(value)){
                    return '用户名首尾不能出现下划线\'_\'';
                }
            },
            password: [/^.{6,12}$/, '密码必须6到12位'],
            vercode: [/^.{5}$/, '验证码必须5位'],
        });

    });
</script>
</body>
</html>